package com.weixin.paleituo.adapter;

/**
 * Author yichao
 * Time  2017/12/12 15:57
 * Dest  正常商品
 *
 */

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.weixin.paleituo.R;
import com.weixin.paleituo.bean.GoodsListBean;

import java.util.ArrayList;

public class HorizontalScrollViewGoodsItemAdapter extends AbHorizontalScrollViewAdapter<GoodsListBean>
{

    public HorizontalScrollViewGoodsItemAdapter(Context context, ArrayList<GoodsListBean> mDatas)
    {
        super(context,mDatas);
    }

    public View getView(final int position, View convertView, ViewGroup parent)
    {
        ViewHolder viewHolder = null;
        if (convertView == null)
        {
            viewHolder = new ViewHolder();
            convertView = mInflater.inflate(
                    R.layout.item_goods_icon, parent, false);
            viewHolder.mImg = (ImageView) convertView.findViewById(R.id.iv_item_goods_icon);


            convertView.setTag(viewHolder);
        } else
        {
            viewHolder = (ViewHolder) convertView.getTag();
        }
      //  viewHolder.mImg.setImageResource(mTS.get(position).getInteger());
        Glide.with(mContext).load(mTS.get(position).getListUrl()).into(viewHolder.mImg);



        return convertView;
    }

    private class ViewHolder
    {
        ImageView mImg;

    }

}

